<template>
    <div>
        <show-mark-down-note type='article' ></show-mark-down-note>
        <license :views="views" :time="time"></license>
        <comment :id="id" type="article"></comment>
    </div>
</template>

<script>
import { fetchNoteInfo } from '../Api'
import comment from "../components/comment.vue"
import License from '../components/license.vue'
import ShowMarkDownNote from '../components/ShowMarkDownNote.vue'
export default {
    components: { comment, License, ShowMarkDownNote },
        data() {
            return {
                content: '',
                id: '',
                views: '',
                time: 0,
            }
        },
        created() {
            fetchNoteInfo({name:`/${this.$route.params.dir}/${this.$route.params.file}`}).then(res=>{
                console.log(res);
                this.views = res.data.views
                this.id = res.data.id
                this.time = res.data.time
            }).catch(err=> {
                console.log(err)
            }) 
        }   
    }
</script>

<style lang="less" scoped>
    .comment-container {
        margin: 0 auto;
        width: 70%;
        margin-top: 40px;
    }

</style>